﻿#region

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Vin.Extension.Framework.Upload.Options;
using Vin.Tool.AspNetCore.Singleton;

#endregion

namespace Vin.Extension.Framework.Upload;

public class ExtensionEntry : IVinApiExtension
{
    public void AddVinExtension(WebApplicationBuilder builder)
    {
    }

    public void AddVinExtension(IServiceCollection services)
    {
        // services.Configure<UploadOption>(VinApp.Configuration.GetSection("VinUpload"));
    }

    public void UseVinExtension(IApplicationBuilder app)
    {
        #region 使用静态文件

        // 静态文件访问
        app.UseStaticFiles(new StaticFileOptions
        {
            FileProvider = new PhysicalFileProvider(AppContext.BaseDirectory)
        });

        #endregion
    }
}